package com.jmb.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;


/**
 * 
 * @TableName t_interface_case
 */
@TableName(value ="t_interface_case")
@Data
public class InterfaceCase  extends BaseEntity{
    /**
     * 项目名称
     */
    @Schema(description = "项目名称")
    @NotNull(message = "项目名称不能为空")
    @TableField(value = "project_id")
    private Long projectId;

    /**
     * 模块编号
     */
    @Schema(description = "模块编号")
    @NotNull(message = "模块编号不能为空")
    @TableField(value = "module_id")
    private Long moduleId;

    /**
     * 请求地址
     */
    @Schema(description = "请求地址")
    @NotBlank(message = "url不能为空")
    @Size(max = 200, message = "url长度必须小于等于200")
    @TableField(value = "url")
    private String url;

    /**
     * 请求方式  0get,1post,2patch,3put,4delete,5head,6options,7trace
     */
    @Schema(description = "请求方式 0get,1post,2patch,3put,4delete,5head,6options,7trace")
    @Max(value = 4, message = "请求方式必须为0~4")
    @Min(value = 0, message = "请求方式必须为0~4")
    @NotNull(message = "请求方式不能为空")
    @TableField(value = "method")
    private Integer method;

    /**
     * 用例描述
     */
    @Schema(description = "用例描述")
    @Size(max = 1000, message = "用例描述长度必须小于等于1000")
    @TableField(value = "description")
    private String description;

    /**
     * 用例级别0高，1中，2低
     */
    @Schema(description = "用例级别 0高，1中，2低")
    @NotNull(message = "用例等级不能为空")
    @Max(value = 2, message = "用例等级必须为0~4")
    @Min(value = 0, message = "用例等级必须为0~4")
    @TableField(value = "level")
    private Integer level;

    /**
     * 接口文档地址
     */
    @Schema(description = "接口文档地址")
    @Size(max = 200, message = "接口文档地址长度必须小于等于200")
    @TableField(value = "doc")
    private String doc;

    /**
     * 请求头
     */

    @Schema(description = "请求头")
    @TableField(value = "headers")
    private String headers;

    /**
     * 请求参数
     */
    @Schema(description = "请求参数")
    @TableField(value = "params")
    private String params;

    /**
     * form data encoded
     */
    @Schema(description = " form data encoded ")
    @TableField(value = "form_data_encoded")
    private String formDataEncoded;

    /**
     * 请求form data
     */
    @Schema(description = "请求 form data")
    @TableField(value = "form_data")
    private String formData;

    /**
     * 请求体
     */
    @Schema(description = "请求体")
    @TableField(value = "raw")
    private String raw;

    /**
     * raw类型 "Text" "JSON" "HTML" "XML"
     */
    @Schema(description = "raw类型 Text JSON HTML XML")
    @TableField(value = "raw_type")
    private String rawType;

    /**
     * 请求体类型0form-data 1x-www-form-Encoded 2raw 9none
     */
    @NotNull(message = "body类型不能为空")
    @Schema(description = "请求体类型 0form-data 1x-www-form-Encoded 2raw 9none")
    @TableField(value = "body_type")
    private Integer bodyType;

    /**
     * 用例创建人
     */

    @Schema(description = "用例创建人")
    @NotNull(message = "创建者不能为空")
    @Size(min = 1, max = 20, message = "创建者长度必须为1~20")
    @TableField(value = "creater")
    private String creater;

    /**
     * 来源0新增1excel导入2csv导入3json导入4yaml导入5har导入
     */
    @Schema(description = "来源 0新增1excel导入2csv导入3json导入4yaml导入5har导入")
    @TableField(value = "source")
    private Integer source;

    /**
     * 导入编号
     */
    @Schema(description = "导入编号")
    @TableField(value = "import_no")
    private String importNo;
}